package com.cl.code.entity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author chengliang
 * @since 1.0.0
 */
public class Expert {

    private final int id;

    private final String name;

    private final List<Major> majors = new ArrayList<>();

    public Expert(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public void setMajors(Major... majors) {
        this.majors.addAll(Arrays.asList(majors));
    }

    public List<Major> getMajors() {
        return majors;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name;
    }
}
